#include "CommandDelete.h"

void CommandDelete::execute() {
	if( _deleteType == DELETE_INDEX ) {
		_logicDelete->deleteTaskByIndex( _index );
	} else if( _deleteType == DELETE_SEARCHTERM ) {
		_logicDelete->deleteTaskByString( _searchType );
	} else if( _deleteType == DELETE_DONE ) {
		_logicDelete->deleteDoneTask( _done );
	} else {
		// idle state
	}
}

CommandDelete::CommandDelete( DeleteType deleteType, int index ) {
	_deleteType = deleteType;
	_index = index;
}

CommandDelete::CommandDelete( DeleteType deleteType, string searchType ) {
	_deleteType = deleteType;
	_searchType = searchType;
}

CommandDelete::CommandDelete( DeleteType deleteType, bool done ) {
	_deleteType = deleteType;
	_done = done;
}

CommandDelete::CommandDelete( DeleteType deleteType ) {
	_deleteType = DELETE_INVALID;
}